﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using Runda.CMS.Common.Utility;
using System.Collections.Generic;
using Runda.CMS.Bll;

namespace Runda.CMS.Portal.Workspace
{
    public partial class MyTask : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindTaskList(1);
            }
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            BindTaskList(AspNetPager1.CurrentPageIndex);
        }

        protected void RepeaterUsers_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName.ToLower() == "refersh")
            {
                BindTaskList(1);
            }
        }

        private void BindTaskList(int pageindex)
        {
            //List<SqlDbParameter> parms = new List<SqlDbParameter>();
            //SqlDbParameter parm = null;
         
            //parm = new SqlDbParameter();
            //parm.ColumnName = "Status";
            //parm.ColumnType = DbType.Int32;
            //parm.ParameterName = "@Status";
            //parm.ParameterValue = 0;
            //parm.QualificationType = SqlDbParameter.QualificationSymbol.Equal;
            //parms.Add(parm);
             

            int RecordCount = 0;
            ContractBll bll = new ContractBll();
            RepeaterUsers.DataSource = bll.GetMyTask(CurrentUserID, null, "CreatedOn desc", AspNetPager1.PageSize, pageindex, out RecordCount);
            RepeaterUsers.DataBind();

            AspNetPager1.RecordCount = RecordCount;
        }
    }
}
